package com.shz.appletsapi.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.shz.appletsapi.model.po.MineAccount;
import com.shz.appletsapi.model.po.MineChannel;
import com.shz.appletsapi.repository.MineAccountRepository;
import com.shz.appletsapi.repository.MineChannelRepository;

@Service
public class MineAccountService {
	
	@Autowired
	private MineAccountRepository mineAccountRepository;
	
	@Autowired
	private MineChannelRepository mineChannelRepository;
	
	public List<MineAccount> findByStatus(Integer status,String channel){
		MineChannel mineChannel=mineChannelRepository.findByName(channel);
		if(mineChannel == null) return null;
		return mineAccountRepository.findByStatusAndChannelId(status,mineChannel.getId());
	}

}
